package com.xiaodao.config;

import com.sun.prism.shader.Solid_TextureYV12_AlphaTest_Loader;
import com.xiaodao.anno.XiaodaoScan;
import com.xiaodao.beandefinition.CustomerAopBeanPostProcessor;
import com.xiaodao.cglibtest.EE;
import com.xiaodao.cglibtest.FF;
import com.xiaodao.imports.MyImportBeanDefinition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.*;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;

@Configuration
@ComponentScan("com.xiaodao")
//@EnableAspectJAutoProxy(proxyTargetClass = true)
//@MapperScan("com.xiaodao.dao")
//@XiaodaoScan
//@Import(CustomerAopBeanPostProcessor.class)
public class AppConfig {


/*	@Bean
	@Autowired
	public SqlSessionFactoryBean sqlSessionFactory(DataSource dataSource){
		SqlSessionFactoryBean sqlSessionFactoryBean =  new SqlSessionFactoryBean();
		sqlSessionFactoryBean.setDataSource(dataSource);
		return sqlSessionFactoryBean;
	}

	@Bean
	public DataSource dataSource() {
		DriverManagerDataSource dataSource = new DriverManagerDataSource();
		dataSource.setDriverClassName("com.mysql.jdbc.Driver");
		dataSource.setUsername("root");
		dataSource.setPassword("root");
		dataSource.setUrl("jdbc:mysql://localhost:3306/test?serverTimezone=UTC");
		return dataSource;
	}*/

/*	@Bean
	public EE ee() {
		System.out.println("e 方法");
		return new EE();
	}
	@Bean
	public FF ff() {

		this.ee();
		System.out.println("f 方法");
		return new FF();
	}*/

}
